package com.arofoxmsn.utils;

public class ParamtersTool {
	/**
	 * this method is in charge of checking null objets
	 * @param args
	 */
	public static void checkNullObject(Object ...args){
		for(Object one : args){
			if(one == null)
				throw new IllegalArgumentException();
		}
	}
	/**
	 * this method is in charge of checking objects. If it finds
	 * one of them that is null it returns true;
	 * @param args
	 * @return <b>true</b> when one object is null
	 */
	public static boolean checkNullObjectBoolean(Object ...args){
		try{
			checkNullObject(args);
			return true;
		}catch(IllegalArgumentException e){
			return false;
		}
	}
	
	public static void checkEmptyString(String...args){
		try{
			checkNullObject(args);
			for(String one : args){
				if(one.equals(""))
					throw new IllegalArgumentException();
			}
		}catch(IllegalArgumentException e){
			throw new IllegalArgumentException();
		}
	}
	
	public static boolean checkEmptyStringBolean(String...args){
		try{
			checkEmptyString(args);
			return true;
		}catch(IllegalArgumentException e){
			return false;
		}
	}
}
